// 递归解决树形数据转换
export default function digui (arr,pid = '') {
    let newArr = []
    arr.forEach(ele => {
      if (ele.pid == pid) {
        let child = digui(arr,ele.id)
        if (child.length) {
          ele.children = child
        }
        newArr.push(ele)
      }
    })
    return newArr
  }